{% extends 'PHPDishWebBundle::layout.html.twig' %}

{% block title %}注册{% endblock %}

{% block script %}
    <script type="text/javascript" src="{{ asset('build/js/sign.js') }}"></script>
{% endblock %}

{% block content %}
<div class="container">
    <div class="row">
        <div class="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">
            {{ form_start(form, {'method': 'post', 'action': path('fos_user_registration_register'), 'attr':{'class': 'reg-page', 'id': 'register-form'}}) }}
                <div class="reg-header">
                    <h2>注册一个新账户</h2>
                    <p>已经有账户?点此<a href="{{ path('login') }}">登录</a>你的账户</p>
                </div>
                {% for flashMessage in app.session.flashbag.get('notice') %}
                    <span class="black-text">{ flashMessage }}</span>
                {% endfor %}
                <div class="group">
                    <div class="input-group">
                        <span class="input-group-addon"><i class="if i-user"></i></span>
                        {{ form_widget(form.username, {'attr': {'class': 'form-control', 'placeholder': '你的用户名'}})  }}
                    </div>
                    {{ form_errors(form.username) }}
                </div>
                <div class="group">
                    <div class="input-group">
                        <span class="input-group-addon"><i class="if i-email"></i></span>
                        {{ form_widget(form.email, {'attr': {'class': 'form-control', 'placeholder': '你的邮箱'}})  }}
                    </div>
                    {{ form_errors(form.email) }}
                </div>
                <div class="group">
                    <div class="input-group">
                        <span class="input-group-addon"><i class="if i-password"></i></span>
                        {{ form_widget(form.plainPassword.first, {'attr': {'class': 'form-control', 'placeholder': '设置密码'}})  }}
                    </div>
                    {{ form_errors(form.plainPassword.first) }}
                </div>
                <div class="group">
                    <div class="input-group">
                        <span class="input-group-addon"><i class="if i-password"></i></span>
                        {{ form_widget(form.plainPassword.second, {'attr': {'class': 'form-control', 'placeholder': '重复上面的密码'}})  }}
                    </div>
                    {{ form_errors(form.plainPassword.second) }}
                </div>
                <div class="row">
                    {#<div class="col-lg-6 checkbox">#}
                        {#<label>#}
                            {#<input type="checkbox" name="agree_policy">#}
                            {#<span>我同意</span> <a href="#" target="_blank">注册用户协议</a>#}
                        {#</label>#}
                        {#<span id="for_policy"></span>#}
                    {#</div>#}
                    <div class="col-lg-12 text-center">
                        <button class="btn btn-block u-btn-primary" type="submit">注册</button>
                    </div>
                </div>
            {{ form_end(form) }}
        </div>
    </div>
</div>
{% endblock %}